﻿using System.ServiceModel;
using Microsoft.CodeMarkers.Contracts;

namespace Microsoft.CodeMarkers.Internal
{
    class CodeMarkerService : ICodeMarkerService
    {
        public void RegisterClient(string key)
        {
            CodeMarkerServiceHost host = CodeMarker.ServiceHost;

            if (host != null)
            {
                host.RegisterClient(key, OperationContext.Current.GetCallbackChannel<ICodeMarkerClient>());
            }
        }


        public void ReleaseClient(string key)
        {
            CodeMarkerServiceHost host = CodeMarker.ServiceHost;

            if (host != null)
            {
                host.ReleaseClient(key);
            }
        }
    }
}
